<link rel="stylesheet" href="https://file.viplgw.cn/ui/thinku-ielts-new/css/case/detail.css?v=1.1.1">


<section id="caseDetail">
    <p class="headlineTitle"><a href="/">首页</a> &gt; <a href="/case.html">高分案例</a> > <?php echo $data['studentName'] ?>
    </p>
    <div class="headlineCover">
        <div class="headlineLeft">
            <div class="headArticleName">
                <h1 class="articleTitle"><?php echo $data['name'] ?></h1>
                <div class="articleAuthCover">
                    <?php echo date('Y-m-d', $data['createTime']) ?>
                    ｜来源：<?php echo $data['author'] == false ? '申友雅思' : $data['author'] ?>
                </div>
                <div class="summary">
                    <p>摘要：</p>
                    <p><?php echo $data['summary'] ?></p>
                </div>
                <p class="trainee">学员</p>
                <div class="traineeCover">
                    <div class="traineeLeft">
                        <img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/guide/29@2x.png" alt="">
                        <p><?php echo $data['studentName'] ?></p>
                    </div>
                    <div class="traineeRight">
                        <p class="traineeRightTitle">雅思成绩</p>
                        <p class="traineeRightTime">出分时间：<?php echo $data['outTime'] ?></p>
                        <div class="fraction">
                            <p class="learnP">学前：</p>
                            <table class="add_yatable" cellspacing="0">
                                <tr style="height: 49px;background: #DFE4F7;font-size: 14px;text-align: center;">
                                    <td style="width: 82px;">听力</td>
                                    <td style="width: 82px;">口语</td>
                                    <td style="width: 82px;">阅读</td>
                                    <td style="width: 82px;">写作</td>
                                    <td style="width: 82px;">总分</td>
                                </tr>
                                <tr style="height: 49px;background: #DFE4F7;font-size: 14px;text-align: center;">
                                    <?php $preScore = explode(',', $data['preScore']);
                                    foreach ($preScore as $v) {
                                        ?>
                                        <td style="width: 82px;"><?php echo $v ?></td>
                                    <?php } ?>
                                </tr>
                            </table>
                        </div>
                        <div class="fraction">
                            <p class="learnP">学后：</p>
                            <table class="add_yatable" cellspacing="0">
                                <tr style="height: 49px;background: #DFE4F7;font-size: 14px;text-align: center;">
                                    <td style="width: 82px;">听力</td>
                                    <td style="width: 82px;">口语</td>
                                    <td style="width: 82px;">阅读</td>
                                    <td style="width: 82px;">写作</td>
                                    <td style="width: 82px;">总分</td>
                                </tr>
                                <tr style="height: 49px;background: #DFE4F7;font-size: 14px;text-align: center;">
                                    <?php $afterScore = explode(',', $data['afterScore']);
                                    foreach ($afterScore as $v) {
                                        ?>
                                        <td style="width: 82px;"><?php echo $v ?></td>
                                    <?php } ?>
                                </tr>
                            </table>
                        </div>
                        <p class="traineeRightTime">雅思课程：<?php echo $data['class'] ?></p>
                        <img src="<?php echo $data['pic'] ?>" alt="" class="courseImgGrades">
                    </div>
                </div>
                <p class="feedback">学员反馈：</p>
                <div class="feedbackContent">
                    <?php echo $data['content'] ?>
                </div>
            </div>
            <!-- 资讯推荐-->
            <div class="infoRecommon">
                <p class="recommonTitle">资讯推荐</p>
                <?php foreach ($recommend as $v) { ?>
                    <a href="<?php echo $v['cate'] == 3 ? '/news-headline/' . $v['id'] . '.html' : '/news-information/' . $v['id'] . '.html' ?>"
                       class="recommonItem">
                        <p><?php echo $v['name'] ?></p>
                        <span><?php echo $v['author'] == false ? '申友' : $v['author'] ?>发布于<?php echo $v['pushTime'] == false ? date('Y-m-d', $v['createTime']) : date('Y-m-d', $v['pushTime']) ?></span>
                    </a>
                <?php } ?>
            </div>
        </div>
        <div class="headlineRight">
            <!-- 体验课程 -->
            <div class="experienceCourse">
                <div class="experienceContent">
                    <div class="subjectType">
                        <input type="radio" id="listen" v-model="subject" value="听力">
                        <label for="listen"><span>听力</span></label>
                        <input type="radio" id="speak" v-model="subject" value="口语">
                        <label for="speak"><span>口语</span></label>
                        <input type="radio" id="read" v-model="subject" value="阅读">
                        <label for="read"><span>阅读</span></label>
                        <input type="radio" id="write" v-model="subject" value="写作">
                        <label for="write"><span>写作</span></label>
                        <input type="radio" id="all" v-model="subject" value="全科">
                        <label for="all"><span>全科</span></label>
                    </div>
                    <input type="text" v-model="phone" class="phoneNum" placeholder="请输入您的手机号码">
                    <div class="phoneCodeCover">
                        <input type="text" v-model="code" class="phoneCode" placeholder="验证码">
                        <a href="javascript:void(0)" class="codeBtn" @click="getCode">{{text}}</a>
                    </div>
                    <a href="javascript:void(0)" class="upBtn" @click="submitSure">获取提分方案</a>
                </div>
                <!-- 成功 -->
                <div class="popupSuccess" v-if="successPhone" v-cloak>
                    <div class="successCenter">
                        <img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/index/propSuccess.png" alt=""
                             style="width: 70px;margin-bottom: 20px;">
                        <p>恭喜您！</p>
                        <p>已获取您的提分方案</p>
                        <p>稍候会有专业老师与您联系</p>
                        <p>请保持手机通畅</p>
                        <a href="javascript:void(0)" @click="successPhone = false" class="successPhoneBtn">好的</a>
                    </div>
                </div>
            </div>
            <!-- 热门课程 -->
            <div class="hotCourseCover">
                <div class="rightTitle">
                    <p>申友雅思热门课程</p>
                    <a href="/mall.html">MORE <img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/4@2x.png"
                                                   alt=""></a>
                </div>
                <?php foreach ($course as $k => $v) { ?>
                    <div class="hotCourseItem">
                        <p class="itemCourseTitle">
                            <img src="<?php echo $v['pic'] ?>" alt="">
                            <span><?php echo $v['name'] ?></span>
                        </p>
                        <p class="courseInfo">
                            <img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/7@2x.png" alt="">
                            <?php echo $v['classTime'] ?></p>
                        <p class="courseInfo">
                            <img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/6@2x.png" alt=""
                                >
                            <?php echo $v['duration'] ?>课时
                        </p>
                        <div class="courseBtn">
                            <a href="https://p.qiao.baidu.com/cps/chat?siteId=16998561&userId=33849315&siteToken=0848542c0e71b685b68768fcec8e99ef"
                               target="_blank" class="zxBtn">立即咨询</a>
                            <a href="/course-detail/<?php echo $v['id'] ?>.html" class="detailBtn">查看详情</a>
                        </div>
                    </div>
                <?php } ?>
            </div>
            <!-- 雅思指南 -->
            <div class="hotCourseCover">
                <div class="rightTitle">
                    <p>雅思指南</p>
                </div>
                <div class="guideCover">
                    <a href="http://www.thinkuprep.com/guide.html">
                        <div><img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/9@2x.png" alt=""></div>
                        <p>考试指南</p>
                        <a href="http://www.thinkuprep.com/ieltstestcenter.html">
                            <div><img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/11@2x.png" alt=""></div>
                            <p>考试地点</p>
                            <a href="http://www.thinkuprep.com/calendar.html">
                                <div><img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/13@2x.png" alt="">
                                </div>
                                <p>考试日历</p></a>
                            <a href="http://www.thinkuprep.com/city.html">
                                <div><img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/10@2x.png" alt="">
                                </div>
                                <p>校区查询</p></a>
                            <a href="http://www.thinkuprep.com/teacher.html">
                                <div><img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/16@2x.png" alt="">
                                </div>
                                <p>师资团队</p></a>
                            <a href="http://www.thinkuprep.com/active.html">
                                <div><img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/zx/15@2x.png" alt="">
                                </div>
                                <p>热门活动</p></a>
                </div>
            </div>
        </div>
    </div>
</section>

<script>
    window.caseDetail = new Vue({
        el: '#caseDetail',
        data() {
            return {
                phone: '',
                code: '',
                time: 60,
                isSend: false,
                subject: '',
                text: '获取验证码',
                successPhone: false,
            }
        },
        created() {

        },
        mounted() {

        },
        methods: {
            getCode() {
                let that = this;
                let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
                if (that.phone.replace(/\s*/g, "") != '' && myreg.test(that.phone)) {
                    if (!that.isSend) {
                        that.isSend = true;
                        $.post('/cn/api/phone-code', {
                            phone: that.phone
                        }, function (res) {
                            if (res.code == 1) {
                                let timer = setInterval(function () {
                                    that.time--;
                                    if (that.time >= 0) {
                                        that.text = that.time + 's';
                                    } else {
                                        clearInterval(timer);
                                        that.isSend = false;
                                        that.text = '获取验证码';
                                        that.time = 60;
                                    }
                                }, 1000)
                            } else {
                                that.isSend = false;
                                alert(res.message)
                            }
                        }, 'json')

                    }
                } else {
                    alert('手机号码有误');
                }
            },
            submitSure() {
                let that = this;
                let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
                if (that.subject == '') {
                    alert('请选择科目');
                    return false;
                }
                if (that.phone.replace(/\s*/g, "") != '' && myreg.test(that.phone) && that.code.replace(/\s*/g, "") != '') {
                    $.post('/cn/api/leave-words', {
                        phone: that.phone,
                        code: that.code,
                        remark: that.subject + ': 制定提分方案',
                    }, function (res) {
                        if (res.code == 1) {
                            that.successPhone = !that.successPhone;
                        } else {
                            alert(res.message)
                        }
                    }, 'json')

                } else {
                    alert('手机号码/验证码有误')
                }

            },
        },
    });
</script>
